import argparse


def get_character_count(file: str, type: str):
    print(type)
    with open(file, "rb") as f:
        if type == "whole":
          data = f.read()
          return len(data)
        else:
          total = 0
          for line in f.readlines():
            total+= len(str(line.strip()))
          return total

if __name__ == "__main__":
    parser = argparse.ArgumentParser()
    parser.add_argument("file")
    parser.add_argument("--type")
    args = parser.parse_args()    
    count = get_character_count(**vars(args))
    print(f"count:{count}")
